package com.geely.dead;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author Monkey
 * @date 2020/7/13 9:57
 * @description ${直连型信息接收监听类}  通配符模式
 * @Copyright © 吉利汽车
 * @Version: 1.0
 */
@Component

public class DeadQueueReceiver {

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(value ="dlx.queue", durable = "true"),
            exchange = @Exchange(value="dlx.exchange", durable = "true", type="topic"),
            key = "topic.*"
    ))
    public void process(Message testMessage) {
        System.out.println("dead消费死信队列  : " + new String(testMessage.getBody()));
    }
}
